home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / computer vision recognition / rcinstall.exe / Disk1 / data1.cab / ASP_Pages / CoverSheet.asp < prev    next >
Encoding:
Text File  |  2001-12-12  |  15.4 KB  |  397 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  6. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  7.         <style media="screen" type="text/css"><!--
  8. td   { valign: top; color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  9. div { color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  10. input  { color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  11. option  { color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  12. select { color: black; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  13. #newCoversheet   { position: absolute; z-index: 10; top: 10px; left: 10px; width: 59px; height: 90px; visibility: visible }
  14. .errorMessage { color: red; font-weight: bold; font-size: 11px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
  15. --></style>
  16.  
  17. <%@ LANGUAGE = VBScript %>
  18. <%
  19.     if Application("PubTypesPath")="" then
  20.         Dim Vroot,iCount,idx
  21.         Vroot = Server.MapPath("Default.asp")
  22.         iCount = 0
  23.         idx = InStrRev(Vroot, "\")
  24.         if (idx > 0) and (idx < len(Vroot)) then
  25.                 Vroot = Left(Vroot,idx-1)
  26.         end if
  27.         Application("PubTypesPath")=Vroot & "\PubTypes"
  28.         Application("XMLDirectory")=Vroot & "\XMLBATCH"
  29.         Application("SiteIDFile")=Vroot & "\siteid.txt"
  30.         Application("LogFile")=Vroot & "\csweblog.txt"
  31.     end if
  32.  
  33. if Request.Form("BatchClassID")="" then
  34. '    response.redirect("Default.asp?lang=" & Request.QueryString("lang"))    
  35.     response.redirect("Default.asp")    
  36. end if        
  37. '---------------------------------------------------------------------------------------------------
  38. 'Getting static information
  39. '---------------------------------------------------------------------------------------------------
  40.  
  41. Function CorrectStr(StrIn)
  42.     Dim StrOut
  43.     StrOut=replace(StrIn,"<","<")
  44.     StrOut=replace(StrOut,">",">")
  45.     CorrectStr=replace(StrOut,chr(13),"<br>")
  46. End Function
  47. Function ConvertStr(StrIn)
  48.     Dim StrOut
  49.     StrOut=replace(StrIn,"´",chr(39))
  50.     StrOut=replace(StrOut,""",chr(34))
  51.     ConvertStr=StrOut
  52. End Function
  53.  
  54.  
  55. '---------------------------------------------------------------------------------------------------
  56. 'Getting local strings
  57. '--------------------------------------------------------------------------------------------------
  58.         dim oConn,oRs,sFilePath,sLangTable
  59.         dim display(21) 
  60.         On Error Resume Next
  61.         set oConn = Server.CreateObject("ADODB.Connection")
  62.         sFilePath=Server.MapPath("csuiweb.mdb")
  63.         
  64.         oConn.Open("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & sFilePath & ";")
  65.         if err then
  66.                set oConn=nothing
  67.             err.clear
  68.             Response.Redirect("Error.asp?Err=1")
  69.         end if
  70.         sLangTable=mid(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"),1,2)
  71.         if trim("" & sLangTable)="" then
  72.             sLangTable="En"
  73.         end if    
  74.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
  75.         if (err and (Err.Number=-2147217865)) then        
  76.             err.Clear
  77.             sLangTable="En"
  78.             Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=0")
  79.         end if        
  80.         Response.Write("<META HTTP-EQUIV='CONTENT-LANGUAGE' CONTENT='" & oRS("Value") & "'>")
  81.             
  82.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id between 1 and 2  ")
  83. 'Full p name
  84.         display(0)=oRs("Value")
  85.         oRs.moveNext
  86. 'Short pro name
  87.         display(1)=oRs("Value")            
  88.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=9")
  89. 'Coversheet
  90.         display(2)=oRs("Value")
  91.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id between 11 and 12")
  92. 'Important
  93.         display(3)=oRs("Value")
  94. 'This...expiration...
  95.         oRs.moveNext
  96.         display(4)=oRs("Value")
  97.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =14")
  98. 'This ...MFP.....
  99.         display(5)=oRs("Value")
  100.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =21")
  101. 'Create new coversheet
  102.         display(6)=oRs("Value")
  103.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =23")
  104. 'Midnight...
  105.         display(7)=oRs("Value")
  106.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =24")
  107. 'barcode data
  108.         display(8)=oRs("Value")
  109.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =25")
  110. 'Create date
  111.         display(9)=oRs("Value")
  112.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =26")
  113. 'Expiration date
  114.         display(10)=oRs("Value")
  115.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =22")
  116. 'Document type
  117.         display(11)=oRs("Value")
  118.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =27")
  119. 'Document name
  120.         display(12)=oRs("Value")
  121.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =28")
  122. 'Site ID
  123.         display(13)=oRs("Value")
  124.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id =29")
  125. 'Site name
  126.         display(14)=oRs("Value")
  127. 'Error on getting published data.ActiveX can not create component.
  128.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=37")
  129.         display(15)=oRs("Value")
  130. 'Error on updating data.
  131.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=38")
  132.         display(16)=oRs("Value")
  133. 'Error on generating XML file
  134.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=39")
  135.         display(17)=oRs("Value")
  136. 'Error on opening siteid.txt file
  137.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=40")
  138.         display(18)=oRs("Value")
  139. 'Error on getting SiteID information
  140.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=41")
  141.         display(19)=oRs("Value")
  142. 'Error on creating FileSystemObject component.         
  143.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=42")
  144.         display(20)=oRs("Value")
  145. 'Client IP         
  146.         Set oRs=oConn.Execute("SELECT * FROM " & sLangTable & " WHERE Id=46")
  147.         display(21)=oRs("Value")
  148.         
  149.         oRs.Close
  150.         oConn.Close    
  151.         if err then
  152.             err.clear
  153.             Response.Redirect("Error.asp?Err=1")
  154.         end if
  155. %>
  156.     <title><%=display(1) & " " & display(2)%></title>
  157. <% 
  158.  
  159. '------------------------------------------------------------------------------------------
  160. 'Generating unique file name
  161. 'A file name contains 5 parts
  162. 'two chars:day, two chars:hour, two chars: minute, two chars: second, ten chars: SessionID
  163. '------------------------------------------------------------------------------------------
  164.     Dim sep,inputStr,DocumentType,SiteID,SiteName
  165.     Dim fso, f,XMLFilePath
  166.     dim myDay,myHour,myMinute,mySecond,myTime
  167.     dim XMLFileName,nB,nD,nF,nTemp
  168.     dim oXMLGen,oXMLUI
  169.     myTime=now
  170.     myDay="" & day(date)
  171.     myDay= string(2-len(myDay),"0") & myDay
  172.     MyHour = "" & hour(myTime)
  173.     MyHour=string(2-len(myHour),"0") & myHour
  174.     MyMinute = "" & minute(myTime)
  175.     MyMinute=string(2-len(myMinute),"0") & myMinute
  176.     MySecond ="" & Second(myTime)
  177.     MySecond=string(2-len(mySecond),"0") & mySecond
  178.     XMLFileName=MyDay & myHour & myMinute & mySecond & string(10-len(Session.SessionID)," ") & Session.SessionID
  179.     XMLFilePath=Application("XMLDirectory") & "\" & XMLFileName & ".xml"
  180.  
  181. '--------------------------------------------------------------------------------------------
  182. 'getting Site ID,Site Name from siteid.txt file
  183. '--------------------------------------------------------------------------------------------
  184. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  185. if err then
  186.     response.write("<table><tr><td class='errorMessage'>" & display(20) & "</td></tr></table>")
  187.     err.clear
  188.     response.end
  189. end if    
  190. set f =fso.OpenTextFile(Application("SiteIDFile"))
  191. if err then
  192.     response.write("<table><tr><td class='errorMessage'>" & display(18) & "</td></tr></table>")
  193.     err.clear
  194.     response.end
  195. end if    
  196.  
  197. SiteID=f.ReadLine
  198. if err then
  199.     response.write("<table><tr><td class='errorMessage'>" & display(19) & "</td></tr></table>")
  200.     err.clear
  201.     response.end
  202. end if
  203. SiteName=f.ReadLine
  204. if err then
  205.    err.clear
  206.    SiteName=""
  207. end if       
  208. f.Close
  209. set fso=nothing
  210.  
  211. '--------------------------------------------------------------------------------------------
  212. 'Generating a XML file for import session
  213. '--------------------------------------------------------------------------------------------
  214.  
  215. Dim nBatchClassID,nPriority,nBatchFieldNumber,nIndexFieldNumber,sBatchClassName,sBatchName
  216.  
  217. nBatchClassID=0 + Request.Form("BatchClassID")
  218. nBatchFieldNumber=0 + Request.Form("BatchFieldNumber")
  219. nPriority=0 + Request.Form("Priority")
  220. nIndexFieldNumber=0 + Request.Form("IndexFieldNumber")
  221. nFixedPageCount=0 + Request.Form("FixedPageCount")
  222. set oXMLGen=CreateObject("RCXMLWEB.RCXMLGen")
  223. if err then
  224.     response.write("<table><tr><td class='errorMessage'>" & display(15) & "</td></tr></table>")
  225.     err.Clear
  226.     Response.End
  227. end if
  228. sBatchClassName="" & Request.Form("BatchClassName")
  229. sBatchName="" & Request.Form("DocumentName")
  230.  
  231. Call oXMLGen.SetBatch(sBatchName,sBatchClassName,nBatchClassID,nPriority)
  232. Call oXMLGen.AddDocument("" & Request.Form("DocumentClassName"),"" & Request.Form("FormTypeName"),nFixedPageCount)
  233. if nBatchFieldNumber>0 then
  234.     if nBatchFieldNumber=1 then
  235.         call oXMLGen.AddBatchField("" & Request.Form("BatchFieldName"),"" & Request.Form("BatchFieldValue"))    
  236.     else
  237.         for nTemp=1 to nBatchFieldNumber
  238.             call oXMLGen.AddBatchField(Request.Form("BatchFieldName")(nTemp),Request.Form("BatchFieldValue")(nTemp))        
  239.         next
  240.     end if
  241. end if
  242. if nIndexFieldNumber=1 then
  243.         call oXMLGen.AddIndexField(ConvertStr(Request.Form("IndexFieldName")),ConvertStr(Request.Form("IndexFieldValue")))    
  244. else
  245.         for nTemp=1 to nIndexFieldNumber
  246.             call oXMLGen.AddIndexField(ConvertStr(Request.Form("IndexFieldName")(nTemp)),ConvertStr(Request.Form("IndexFieldValue")(nTemp)))        
  247.         next
  248. end if
  249. if err then
  250.     response.write("<table><tr><td class='errorMessage'>" & display(16) & "</td></tr></table>")
  251.     Response.End
  252. end if
  253.  
  254. if oXMLGen.WriteXML("" & XMLFilePath)<0 then
  255.     response.write("<table><tr><td class='errorMessage'>" & display(17) & "</td></tr></table>")
  256.     Set fso = CreateObject("Scripting.FileSystemObject")
  257.     set f =fso.OpenTextFile(Application("LogFile"),8,true)
  258.     f.WriteLine oXMLGen.ErrMessage
  259.     f.Close
  260.     set fso=nothing           
  261.     set oXMLGen=nothing
  262.     Response.End
  263. end if   
  264. set oXMLGen=nothing
  265. on error goto 0
  266. '--------------------------------------------------------------------------------------------------
  267. 'End of generating a XML file for import session
  268. '--------------------------------------------------------------------------------------------------
  269. DocumentType=Request.Form("BatchClassName") & "-" & Request.Form("DocumentClassName") & Request.Form("FormTypeName")
  270. %>
  271. </head>
  272.  
  273. <body>
  274.  
  275. <center>
  276. <table cellpadding="1" cellspacing="1" width="600px">
  277.     <tr>
  278.         <td width="72px" rowspan="2" valign="midle" align="center">
  279.         <a href="Default.asp"><img src="images/newCS_icon.gif" width="59" height="59" border="0"><br>
  280.         <%=display(6)%>!</a></div>
  281.         </td>
  282.         <td colspan="2" rowspan="2" align="center" valign="middle" width="228px"><img src="images/logo1.jpg" width="215" height="52" ALT='<%=display(0)%>'>
  283.         </td>
  284. <!--------------------------Filename Barcode --------------------------------------------->
  285.         <td width="300px" colspan="2" align="center" >
  286.             <img src='processing.asp?text=<%=XMLFileName%>' alt='<%=display(0) & " " & display(8)%>'>
  287.         </td>
  288.     </tr>
  289. <!--------------------------SiteID Barcode --------------------------------------------->
  290.     <tr>
  291.         <td width="300px" colspan="2" align="center" >
  292.              <img src='processing.asp?text=<%=SiteID%>' alt='<%=display(0) & " " & display(8)%>'>
  293.         </td>
  294.     </tr>
  295. <!--------------------------Creating date time--------------------------------------------->
  296.     <tr>
  297.         <td align="right" width="126px" colspan="2" valign="top" ><b><%=display(9)%></b>  </td>
  298.         <td align="left" width="174px" ><%=formatdatetime(date,vbLongDate)%></td>
  299. <!----------------------------------------------------------------------------------->
  300.         <td align="left" valign="midle" colspan="3" rowspan="2">
  301.         <b><%=display(3)%>:</b> <%=display(4)%>
  302.         </td>
  303.     </tr>
  304. <!--------------------------Expiration date time--------------------------------------------->
  305.     <tr>
  306.         <td align="right" colspan="2" valign="top"><b><%=display(10)%></b>  </td>
  307.         <td align="left" valign="top"><%=display(7) & formatdatetime(date,vbLongDate)%></td>
  308.     </tr>
  309. <!--- ----------------------Client IP----------------------------------------------------- --->
  310.     <tr>
  311.         <td align="right" colspan="2" valign="top"><b><%=display(21)%></b>  </td>
  312.         <td align="left" valign="top"><%=Request.ServerVariables("REMOTE_ADDR")%></td>
  313.     </tr>
  314.     <tr>
  315.         <td colspan="5" align="center"><hr color="Black" size="1" width="90%"> </td>
  316.     </tr>
  317. <!--------------------------Document type--------------------------------------------->
  318.     <tr>
  319.         <td align="right" colspan="2"><b><%=display(11)%></b>  </td>
  320.         <td colspan="3" align="left"><%=Request.Form("BatchClassName") & " - " & Request.Form("DocumentClassName") & " - " & Request.Form("FormTypeName")%></td>
  321.     </tr>
  322. <!--------------------------Document Name--------------------------------------------->
  323. <!---     
  324.     <tr>
  325.         <td align="right" colspan="2"><b><%=display(12)%></b></td>
  326.         <td colspan="3" align="left">  <%=CorrectStr("" & Request.Form("DocumentName"))%></td>
  327.     </tr>
  328.  --->    
  329. <!--------------------------Site ID--------------------------------------------->
  330.     <tr>
  331.         <td align="right" colspan="2"><b><%=display(13)%></b>  </td>
  332.         <td colspan="3" align="left"><%=CorrectStr(SiteID)%></td>
  333.     </tr>
  334. <!--------------------------Site Name--------------------------------------------->
  335.     <%
  336.     if trim(SiteName)<>"" then
  337.     %>
  338.     <tr>
  339.         <td align="right" colspan="2"><b><%=display(14)%></b>  </td>
  340.         <td colspan="3" align="left"><%=CorrectStr(SiteName)%></td>
  341.     </tr>    
  342.     <%
  343.     end if
  344.     %>
  345.  
  346.     <tr>
  347.         <td colspan="5" align="center"><hr color="Black" size="1" width="90%"> </td>
  348.     </tr>
  349. <!--------------------------Index Fields --------------------------------------------->
  350.     <%
  351.     if nIndexFieldNumber=1 then
  352.     %>
  353.     <tr>
  354.         <td colspan="3" align="right" valign="top"><b><%=CorrectStr(Request.Form("IndexFieldName"))%>:</b>  </td>
  355.         <td colspan="2" align="left" valign="top"><%=CorrectStr(Request.Form("IndexFieldValue"))%></td>
  356.     </tr>
  357.                 
  358.     <%
  359.     elseif (nIndexFieldNumber <4) and (nIndexFieldNumber>1) then                         
  360.         for nTemp=1 to Request.Form("IndexFieldName").Count
  361.     %>
  362.     <tr>
  363.         <td colspan="3" align="right" valign="top"><b><%=CorrectStr(Request.Form("IndexFieldName")(nTemp))%>:</b>  </td>
  364.         <td colspan="2" align="left" valign="top"><%=CorrectStr(Request.Form("IndexFieldValue")(nTemp))%></td>
  365.     </tr>
  366.     <%
  367.         next
  368.     else
  369.         for nTemp=1 to nIndexFieldNumber
  370.             if (nTemp mod 2)=1 then
  371.     %>
  372.                 <tr>
  373.                     <td align="right" colspan="2" valign="top" ><b><%=CorrectStr(Request.Form("IndexFieldName")(nTemp))%>:</b>  </td>
  374.                     <td align="left" valign="top"><%=CorrectStr(Request.Form("IndexFieldValue")(nTemp))%></td>
  375.     <%        
  376.             else
  377.     %>
  378.                     <td align="right" width="126px" valign="top" ><b><%=CorrectStr(Request.Form("IndexFieldName")(nTemp))%>:</b>  </td>
  379.                     <td align="left" width="174px" valign="top"><%=CorrectStr(Request.Form("IndexFieldValue")(nTemp))%></td>                                
  380.                 </tr>
  381.     <%
  382.             end if
  383.         next                    
  384.     end if
  385.     %>
  386.     <tr>
  387.         <td colspan="5" align="center"><hr color="Black" size="1" width="90%"> </td>
  388.     </tr>
  389.     <tr>
  390.         <td colspan="5" valign="middle" align="center"><%=display(5)%></td>
  391.     </tr>
  392.     
  393. </table>
  394. </center>
  395. </body>
  396. </html>
  397.